package com.wm.blog_admin.dao;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wm.blog_admin.domain.CommentDo;
import com.wm.blog_admin.mapper.TCommentMapper;
import com.wm.blog_admin.query.TCommentQuery;
import com.wm.blog_common.base.BaseDAO;
import com.wm.blog_common.bean.PageHelper;
import com.wm.blog_common.bean.QueryPage;
import com.wm.blog_common.domain.TSystemConfigDO;
import com.wm.blog_common.entity.TComment;
import com.wm.blog_common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * 评论表 服务DAO层
 * </p>
 *
 * @author 半卷流年
 * @since 2020-03-24
 */
@Repository
public class TCommentDAO extends BaseDAO<TCommentMapper, TComment> {

    @Autowired
    private TCommentMapper tCommentMapper;

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    public Result<Page<CommentDo>> pageList(QueryPage page, TCommentQuery query) {
        return Result.success(PageHelper.newPage(tCommentMapper.pageList(page,query), CommentDo.class));
    }
}

